package com.example.lenovo.demo;

import android.app.ProgressDialog;
import android.content.Context;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.RecyclerView;

import com.example.lenovo.demo.presenter.listener.CityFirstActivityPresenter;
import com.example.lenovo.demo.view.ifgview.ICityFirstActivity;

import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.ViewInject;
import org.xutils.x;
@ContentView(R.layout.fragment_city)
public class CityFirstActivity extends AppCompatActivity implements ICityFirstActivity{
    private CityFirstActivityPresenter cityFirstActivityPresenter;
    private String id;
    private FragmentManager manager;
    private ProgressDialog progressDialog;
    @ViewInject(R.id.cityfg_recyclerview)
    private RecyclerView recyclerView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        x.view().inject(this);
        init();

    }
    private void init() {
        id=getIntent().getStringExtra("msg");
        manager=getSupportFragmentManager();
        cityFirstActivityPresenter=new CityFirstActivityPresenter(this);
        progressDialog=new ProgressDialog(this);
        progressDialog.setTitle("提示");
        progressDialog.setMessage("正在加载...");
        progressDialog.setCancelable(true);
        cityFirstActivityPresenter.initData();
    }

    @Override
    public String getID() {
        return id;
    }

    @Override
    public RecyclerView getRecyclerView() {
        return recyclerView;
    }

    @Override
    public Context getCityContext() {
        return this;
    }

    @Override
    public ProgressDialog getProgressDialog() {
        return progressDialog;
    }
}
